package com.jyw.business.obstacles.controller;

import com.github.pagehelper.PageHelper;
import com.jyw.business.obstacles.domain.ObsCbOrderInfo;
import com.jyw.business.obstacles.domain.dto.web.ObsCbOrderInfoQueryDto;
import com.jyw.business.obstacles.domain.vo.web.ObsCbOrderInfoVO;
import com.jyw.business.obstacles.service.IObsCbOrderInfoService;
import com.jyw.common.annotation.Anonymous;
import com.jyw.common.core.controller.BaseController;
import com.jyw.common.core.domain.CommonResult;
import com.jyw.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


/**
 * @author wym
 * @description 其他导入工单信息
 * @date 2022/6/29 16:13
 */
@RestController
@Api(tags = "其他工单")
@RequestMapping("/obstacles/obsCbOrderInfo")
public class ObsCbOrderInfoController extends BaseController {

    @Resource
    private IObsCbOrderInfoService iObsCbOrderInfoService;


    @Anonymous
    @PreAuthorize("@ss.hasPermi('obstacles:obsCbOrderInfo:getPageCbOrderInfo')")
    @PostMapping("/getPageCbOrderInfo")
    @ApiOperation("分页查询其他工单")
    public TableDataInfo<ObsCbOrderInfo> getPageCbOrderInfo(@RequestBody ObsCbOrderInfoQueryDto dto) {
        PageHelper.startPage(dto.getPageNum(), dto.getPageSize()).reasonable(true);
        List<ObsCbOrderInfo> list = iObsCbOrderInfoService.getPageCbOrderInfo(dto);
        return getDataTable(list);
    }

    @Anonymous
    @GetMapping("/getById")
    @PreAuthorize("@ss.hasPermi('obstacles:mine:order:getById')")
    @ApiOperation("查询详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "id", required = true),
    })
    public CommonResult<ObsCbOrderInfoVO> getById(String id) {
        return CommonResult.success(iObsCbOrderInfoService.getByInfoId(id));
    }


  /*  @RequestMapping("/getById")
    @ApiOperation(value = "获取其他导入工单信息表", httpMethod = "POST", notes = "获取其他导入工单信息表")
    @ApiResponses({@ApiResponse(code = 200, message = "获取其他导入工单信息成功")})
    public Object getById(String id) {
        return busCbOrderInfoService.getByOrderNum(id);
    }
*/

}
